package com.ywc.tools.adapter;

import android.util.SparseArray;
import android.view.View;

public class BaseViewHold  {
    private View itemView;
    private SparseArray<View> sparseArray;

    public BaseViewHold(View itemView) {
        this.itemView = itemView;
        sparseArray=new SparseArray<>();
    }

    public <T extends View> T fdView(int id)
    {
        View view = sparseArray.get(id);
        if (view==null)
        {
            view=itemView.findViewById(id);
            sparseArray.put(id,view);
        }
        return (T)view;
    }

}
